#pragma once
#include <cocos2d.h>
#include "Enemy.h"

class MainLayer;

USING_NS_CC;

#define WARNING_TAG 10
#define TIME_SCORE 1

class Map : public CCNode
{
public:
	Map(void);
	~Map(void);

	MainLayer* getMainLayer();
	void processing(float dt);
	void startMap();
	virtual bool init();
	//virtual void onEnter();
	virtual void onExit();

	CC_SYNTHESIZE_RETAIN(CCArray*, _listTimeEnemy, TimeEnemies)
	CC_SYNTHESIZE_RETAIN(CCArray*, _listEnemy, Enemies);
	CC_SYNTHESIZE_RETAIN(CCDictionary*, _listEnemyTemplate, EnemyTemplates);
	CC_SYNTHESIZE_RETAIN(CCDictionary*, _listItemTemplate, ItemTemplates);
	CC_SYNTHESIZE_RETAIN(Enemy*, _boss, Boss);
	CC_SYNTHESIZE(float, _currentTime, CurrentTime);
	CC_SYNTHESIZE(bool, _isBossNow, IsBossNow);
	CC_SYNTHESIZE(bool, _isBossShow, IsBossShow);
	CREATE_FUNC(Map);
	CC_SYNTHESIZE(float, _speedUpFactor, SpeedUpFactor);

	void startBossAnimation(CCNode* node);
	void callBoss(CCNode* node);
	void endBossAnimation(CCNode* node);
	bool isMapComplete();

	float _scoreTime;
};

